3.2.57 \(\int x (a+b \log (c x^n)) (d+e \log (f x^r)) \, dx\) [157]

Optimal. Leaf size=84 \[ \frac {1}{8} b e n r x^2-\frac {1}{8} e r x^2 \left (2 a-b n+2 b \log \left (c x^n\right )\right )-\frac {1}{4} b n x^2 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right ) \]

[Out]

1/8*b*e*n*r*x^2-1/8*e*r*x^2*(2*a-b*n+2*b*ln(c*x^n))-1/4*b*n*x^2*(d+e*ln(f*x^r))+1/2*x^2*(a+b*ln(c*x^n))*(d+e*l
n(f*x^r))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {2341, 2413, 12} \begin {gather*} \frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{8} e r x^2 \left (2 a+2 b \log \left (c x^n\right )-b n\right )-\frac {1}{4} b n x^2 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{8} b e n r x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(b*e*n*r*x^2)/8 - (e*r*x^2*(2*a - b*n + 2*b*Log[c*x^n]))/8 - (b*n*x^2*(d + e*Log[f*x^r]))/4 + (x^2*(a + b*Log[
c*x^n])*(d + e*Log[f*x^r]))/2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2413

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.) + Log[(f_.)*(x_)^(r_.)]*(e_.))*((g_.)*(x_))^(m_.), x_Sy
mbol] :> With[{u = IntHide[(g*x)^m*(a + b*Log[c*x^n])^p, x]}, Dist[d + e*Log[f*x^r], u, x] - Dist[e*r, Int[Sim
plifyIntegrand[u/x, x], x], x]] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, r}, x] &&  !(EqQ[p, 1] && EqQ[a, 0] &&
 NeQ[d, 0])

Rubi steps

\begin {align*} \int x \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right ) \, dx &=-\frac {1}{4} b n x^2 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-(e r) \int \frac {1}{4} x \left (2 a \left (1-\frac {b n}{2 a}\right )+2 b \log \left (c x^n\right )\right ) \, dx\\ &=-\frac {1}{4} b n x^2 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )-\frac {1}{4} (e r) \int x \left (2 a \left (1-\frac {b n}{2 a}\right )+2 b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {1}{8} b e n r x^2-\frac {1}{8} e r x^2 \left (2 a-b n+2 b \log \left (c x^n\right )\right )-\frac {1}{4} b n x^2 \left (d+e \log \left (f x^r\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right ) \left (d+e \log \left (f x^r\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 68, normalized size = 0.81 \begin {gather*} \frac {1}{4} x^2 \left (2 a d-b d n-a e r+b e n r+e (2 a-b n) \log \left (f x^r\right )+b \log \left (c x^n\right ) \left (2 d-e r+2 e \log \left (f x^r\right )\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Log[c*x^n])*(d + e*Log[f*x^r]),x]

[Out]

(x^2*(2*a*d - b*d*n - a*e*r + b*e*n*r + e*(2*a - b*n)*Log[f*x^r] + b*Log[c*x^n]*(2*d - e*r + 2*e*Log[f*x^r])))
/4

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.18, size = 1640, normalized size = 19.52

method result size
risch \(\text {Expression too large to display}\) \(1640\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*ln(c*x^n))*(d+e*ln(f*x^r)),x,method=_RETURNVERBOSE)

[Out]

1/2*x^2*a*d-1/8*Pi^2*b*e*x^2*csgn(I*f)*csgn(I*x^r)*csgn(I*f*x^r)*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)-1/4*I*Pi*
ln(f)*b*e*x^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+1/8*Pi^2*b*e*x^2*csgn(I*f)*csgn(I*f*x^r)^2*csgn(I*c)*csgn(I*
x^n)*csgn(I*c*x^n)+1/8*Pi^2*b*e*x^2*csgn(I*x^r)*csgn(I*f*x^r)^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+1/2*ln(c)*
b*d*x^2-1/8*Pi^2*b*e*x^2*csgn(I*x^r)*csgn(I*f*x^r)^2*csgn(I*x^n)*csgn(I*c*x^n)^2-1/4*I*Pi*b*d*x^2*csgn(I*c*x^n
)^3+1/2*ln(f)*ln(c)*b*e*x^2-1/4*ln(f)*b*e*n*x^2-1/4*ln(c)*b*e*r*x^2+1/2*ln(f)*b*e*x^2*ln(x^n)-1/4*b*e*r*x^2*ln
(x^n)+1/4*I*Pi*b*d*x^2*csgn(I*c)*csgn(I*c*x^n)^2+1/4*I*Pi*b*d*x^2*csgn(I*x^n)*csgn(I*c*x^n)^2+(1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i*b*e*n*x^2*csgn(I*f)*
csgn(I*x^r)*csgn(I*f*x^r)+1/8*Pi^2*b*e*x^2*csgn(I*f)*csgn(I*x^r)*csgn(I*f*x^r)*csgn(I*c)*csgn(I*c*x^n)^2+1/4*I
*Pi*ln(c)*b*e*x^2*csgn(I*x^r)*csgn(I*f*x^r)^2

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 106, normalized size = 1.26 \begin {gather*} -\frac {1}{4} \, b d n x^{2} - \frac {1}{4} \, a r x^{2} e + \frac {1}{2} \, b d x^{2} \log \left (c x^{n}\right ) + \frac {1}{2} \, a x^{2} e \log \left (f x^{r}\right ) + \frac {1}{2} \, a d x^{2} + \frac {1}{4} \, {\left ({\left (r - \log \left (f\right )\right )} x^{2} - x^{2} \log \left (x^{r}\right )\right )} b n e - \frac {1}{4} \, {\left (r x^{2} - 2 \, x^{2} \log \left (f x^{r}\right )\right )} b e \log \left (c x^{n}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="maxima")

[Out]

-1/4*b*d*n*x^2 - 1/4*a*r*x^2*e + 1/2*b*d*x^2*log(c*x^n) + 1/2*a*x^2*e*log(f*x^r) + 1/2*a*d*x^2 + 1/4*((r - log
(f))*x^2 - x^2*log(x^r))*b*n*e - 1/4*(r*x^2 - 2*x^2*log(f*x^r))*b*e*log(c*x^n)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 140, normalized size = 1.67 \begin {gather*} \frac {1}{2} \, b n r x^{2} e \log \left (x\right )^{2} + \frac {1}{4} \, {\left (b n - a\right )} r x^{2} e - \frac {1}{4} \, {\left (b d n - 2 \, a d\right )} x^{2} - \frac {1}{4} \, {\left (b r x^{2} e - 2 \, b d x^{2}\right )} \log \left (c\right ) + \frac {1}{4} \, {\left (2 \, b x^{2} e \log \left (c\right ) - {\left (b n - 2 \, a\right )} x^{2} e\right )} \log \left (f\right ) + \frac {1}{2} \, {\left (b r x^{2} e \log \left (c\right ) + b n x^{2} e \log \left (f\right ) + b d n x^{2} - {\left (b n - a\right )} r x^{2} e\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="fricas")

[Out]

1/2*b*n*r*x^2*e*log(x)^2 + 1/4*(b*n - a)*r*x^2*e - 1/4*(b*d*n - 2*a*d)*x^2 - 1/4*(b*r*x^2*e - 2*b*d*x^2)*log(c
) + 1/4*(2*b*x^2*e*log(c) - (b*n - 2*a)*x^2*e)*log(f) + 1/2*(b*r*x^2*e*log(c) + b*n*x^2*e*log(f) + b*d*n*x^2 -
 (b*n - a)*r*x^2*e)*log(x)

________________________________________________________________________________________

Sympy [A]
time = 1.08, size = 126, normalized size = 1.50 \begin {gather*} \frac {a d x^{2}}{2} - \frac {a e r x^{2}}{4} + \frac {a e x^{2} \log {\left (f x^{r} \right )}}{2} - \frac {b d n x^{2}}{4} + \frac {b d x^{2} \log {\left (c x^{n} \right )}}{2} + \frac {b e n r x^{2}}{4} - \frac {b e n x^{2} \log {\left (f x^{r} \right )}}{4} - \frac {b e r x^{2} \log {\left (c x^{n} \right )}}{4} + \frac {b e x^{2} \log {\left (c x^{n} \right )} \log {\left (f x^{r} \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*ln(c*x**n))*(d+e*ln(f*x**r)),x)

[Out]

a*d*x**2/2 - a*e*r*x**2/4 + a*e*x**2*log(f*x**r)/2 - b*d*n*x**2/4 + b*d*x**2*log(c*x**n)/2 + b*e*n*r*x**2/4 -
b*e*n*x**2*log(f*x**r)/4 - b*e*r*x**2*log(c*x**n)/4 + b*e*x**2*log(c*x**n)*log(f*x**r)/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (79) = 158\).
time = 4.01, size = 161, normalized size = 1.92 \begin {gather*} \frac {1}{2} \, b n r x^{2} e \log \left (x\right )^{2} - \frac {1}{2} \, b n r x^{2} e \log \left (x\right ) + \frac {1}{2} \, b r x^{2} e \log \left (c\right ) \log \left (x\right ) + \frac {1}{2} \, b n x^{2} e \log \left (f\right ) \log \left (x\right ) + \frac {1}{4} \, b n r x^{2} e - \frac {1}{4} \, b r x^{2} e \log \left (c\right ) - \frac {1}{4} \, b n x^{2} e \log \left (f\right ) + \frac {1}{2} \, b x^{2} e \log \left (c\right ) \log \left (f\right ) + \frac {1}{2} \, b d n x^{2} \log \left (x\right ) + \frac {1}{2} \, a r x^{2} e \log \left (x\right ) - \frac {1}{4} \, b d n x^{2} - \frac {1}{4} \, a r x^{2} e + \frac {1}{2} \, b d x^{2} \log \left (c\right ) + \frac {1}{2} \, a x^{2} e \log \left (f\right ) + \frac {1}{2} \, a d x^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))*(d+e*log(f*x^r)),x, algorithm="giac")

[Out]

1/2*b*n*r*x^2*e*log(x)^2 - 1/2*b*n*r*x^2*e*log(x) + 1/2*b*r*x^2*e*log(c)*log(x) + 1/2*b*n*x^2*e*log(f)*log(x)
+ 1/4*b*n*r*x^2*e - 1/4*b*r*x^2*e*log(c) - 1/4*b*n*x^2*e*log(f) + 1/2*b*x^2*e*log(c)*log(f) + 1/2*b*d*n*x^2*lo
g(x) + 1/2*a*r*x^2*e*log(x) - 1/4*b*d*n*x^2 - 1/4*a*r*x^2*e + 1/2*b*d*x^2*log(c) + 1/2*a*x^2*e*log(f) + 1/2*a*
d*x^2

________________________________________________________________________________________

Mupad [B]
time = 4.00, size = 82, normalized size = 0.98 \begin {gather*} \ln \left (f\,x^r\right )\,\left (\frac {a\,e\,x^2}{2}-\frac {b\,e\,n\,x^2}{4}+\frac {b\,e\,x^2\,\ln \left (c\,x^n\right )}{2}\right )+x^2\,\left (\frac {a\,d}{2}-\frac {b\,d\,n}{4}-\frac {a\,e\,r}{4}+\frac {b\,e\,n\,r}{4}\right )+\frac {b\,x^2\,\ln \left (c\,x^n\right )\,\left (2\,d-e\,r\right )}{4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(d + e*log(f*x^r))*(a + b*log(c*x^n)),x)

[Out]

log(f*x^r)*((a*e*x^2)/2 - (b*e*n*x^2)/4 + (b*e*x^2*log(c*x^n))/2) + x^2*((a*d)/2 - (b*d*n)/4 - (a*e*r)/4 + (b*
e*n*r)/4) + (b*x^2*log(c*x^n)*(2*d - e*r))/4

________________________________________________________________________________________